package com.hmall.api.client.fallback;

import com.hmall.api.client.CartClient;
import com.hmall.api.client.ItemClient;
import com.hmall.api.dto.ItemDTO;
import com.hmall.api.dto.OrderDetailDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * 自定义FallbackFactory
 */
@Slf4j
public class CartClientFallbackFactory implements FallbackFactory<CartClient> {
    /**
     * 调用失败后的后备解决方案
     * @param cause
     * @return
     */
    @Override
    public CartClient create(Throwable cause) {
        return new CartClient() {
            @Override
            public void deleteCartItemByIds(Collection<Long> ids) {

            }
        };
    }
}
